package io.modelcontextprotocol.autoconfigure.definition;


import io.modelcontextprotocol.autoconfigure.utils.ToolUtils;
import org.springframework.util.Assert;

import java.lang.reflect.Method;

public interface ToolMetadata {
    default boolean returnDirect() {
        return false;
    }

    static DefaultToolMetadata.Builder builder() {
        return DefaultToolMetadata.builder();
    }

    static ToolMetadata from(Method method) {
        Assert.notNull(method, "method cannot be null");
        return DefaultToolMetadata.builder().returnDirect(ToolUtils.getToolReturnDirect(method)).build();
    }
}
